#define crt_secure_no_warnings 1

#include <stdio.h>
#include <stdlib.h>

void print_arr(int arr[], int sz)
{
	int i = 0;
	for (i = 0; i < sz; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}

void cmp_int1(const void* p1,const void* p2)
{
	return (*(int*)p1 - *(int*)p2);
}

void test1()
{
	int arr1[] = { 9,8,7,6,5,4,3,2,1,0 };
	int sz1 = sizeof(arr1) / sizeof(arr1[0]);
	qsort(arr1, sz1, sizeof(arr1[0]), cmp_int1);
	print_arr(arr1, sz1);
}

void cmp_int2(const void* p1, const void* p2)
{
	return (*(char*)p1 - *(char*)p2);
}

void test2()
{
	char arr2[] = { 'A','B','C','D','E' };
	int sz2 = sizeof(arr2) / sizeof(arr2[0]);
	qsort(arr2, sz2, sizeof(arr2[0]), cmp_int2);
}

int main()
{

	test1();
	test2();
	return 0;
}